﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace Sunlit.Business.Migrations
{
    public partial class update_entities : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<string>(
                name: "Avator",
                table: "AbpUsers",
                maxLength: 512,
                nullable: true);

            migrationBuilder.AddColumn<bool>(
                name: "IsRealName",
                table: "AbpUsers",
                nullable: false,
                defaultValue: false);

            migrationBuilder.AlterColumn<string>(
                name: "Content",
                table: "AbpEnterprises",
                nullable: true,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)");

            migrationBuilder.AddColumn<string>(
                name: "Address",
                table: "AbpEnterprises",
                maxLength: 256,
                nullable: true);

            migrationBuilder.AddColumn<decimal>(
                name: "Area",
                table: "AbpEnterprises",
                nullable: false,
                defaultValue: 0m);

            migrationBuilder.AddColumn<string>(
                name: "LinkMan",
                table: "AbpEnterprises",
                maxLength: 32,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "PayMethod",
                table: "AbpEnterprises",
                maxLength: 64,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "PhoneNumber",
                table: "AbpEnterprises",
                maxLength: 32,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "PriceRange",
                table: "AbpEnterprises",
                maxLength: 32,
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "SaleType",
                table: "AbpEnterprises",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<string>(
                name: "Structure",
                table: "AbpEnterprises",
                maxLength: 128,
                nullable: true);

            migrationBuilder.AlterColumn<string>(
                name: "Content",
                table: "AbpCommerces",
                nullable: true,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)");

            migrationBuilder.AddColumn<string>(
                name: "Address",
                table: "AbpCommerces",
                maxLength: 256,
                nullable: true);

            migrationBuilder.AddColumn<decimal>(
                name: "Area",
                table: "AbpCommerces",
                nullable: false,
                defaultValue: 0m);

            migrationBuilder.AddColumn<string>(
                name: "LinkMan",
                table: "AbpCommerces",
                maxLength: 32,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "PayMethod",
                table: "AbpCommerces",
                maxLength: 64,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "PhoneNumber",
                table: "AbpCommerces",
                maxLength: 32,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "PriceRange",
                table: "AbpCommerces",
                maxLength: 32,
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "SaleType",
                table: "AbpCommerces",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<string>(
                name: "Structure",
                table: "AbpCommerces",
                maxLength: 128,
                nullable: true);

            migrationBuilder.CreateTable(
                name: "AbpWishlists",
                columns: table => new
                {
                    Id = table.Column<int>(nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    CreationTime = table.Column<DateTime>(nullable: false),
                    CreatorUserId = table.Column<long>(nullable: true),
                    Title = table.Column<string>(maxLength: 256, nullable: true),
                    LinkUrl = table.Column<string>(maxLength: 512, nullable: true),
                    SliderType = table.Column<int>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_AbpWishlists", x => x.Id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "AbpWishlists");

            migrationBuilder.DropColumn(
                name: "Avator",
                table: "AbpUsers");

            migrationBuilder.DropColumn(
                name: "IsRealName",
                table: "AbpUsers");

            migrationBuilder.DropColumn(
                name: "Address",
                table: "AbpEnterprises");

            migrationBuilder.DropColumn(
                name: "Area",
                table: "AbpEnterprises");

            migrationBuilder.DropColumn(
                name: "LinkMan",
                table: "AbpEnterprises");

            migrationBuilder.DropColumn(
                name: "PayMethod",
                table: "AbpEnterprises");

            migrationBuilder.DropColumn(
                name: "PhoneNumber",
                table: "AbpEnterprises");

            migrationBuilder.DropColumn(
                name: "PriceRange",
                table: "AbpEnterprises");

            migrationBuilder.DropColumn(
                name: "SaleType",
                table: "AbpEnterprises");

            migrationBuilder.DropColumn(
                name: "Structure",
                table: "AbpEnterprises");

            migrationBuilder.DropColumn(
                name: "Address",
                table: "AbpCommerces");

            migrationBuilder.DropColumn(
                name: "Area",
                table: "AbpCommerces");

            migrationBuilder.DropColumn(
                name: "LinkMan",
                table: "AbpCommerces");

            migrationBuilder.DropColumn(
                name: "PayMethod",
                table: "AbpCommerces");

            migrationBuilder.DropColumn(
                name: "PhoneNumber",
                table: "AbpCommerces");

            migrationBuilder.DropColumn(
                name: "PriceRange",
                table: "AbpCommerces");

            migrationBuilder.DropColumn(
                name: "SaleType",
                table: "AbpCommerces");

            migrationBuilder.DropColumn(
                name: "Structure",
                table: "AbpCommerces");

            migrationBuilder.AlterColumn<string>(
                name: "Content",
                table: "AbpEnterprises",
                type: "nvarchar(max)",
                nullable: false,
                oldClrType: typeof(string),
                oldNullable: true);

            migrationBuilder.AlterColumn<string>(
                name: "Content",
                table: "AbpCommerces",
                type: "nvarchar(max)",
                nullable: false,
                oldClrType: typeof(string),
                oldNullable: true);
        }
    }
}
